# -*- coding: utf-8 -*-
from django.shortcuts import render
from blueking.component.shortcuts import get_client_by_request
from home_application.celery_tasks import async_task, execute_task, get_time


# 开发框架中通过中间件默认是需要登录态的，如有不需要登录的，可添加装饰器login_exempt
# 装饰器引入 from blueapps.account.decorators import login_exempt
def home(request):
    """
    首页
    """
     # 调用自己开发的API组件
    # client = get_client_by_request(request)
    # kwargs = {'token': '@adf*adsd^'}
    # resp = client.cm.get_capacity(**kwargs)

    # 执行celery异步任务
    # async_task.delay(1, 2, 1)

    # 执行定时任务
    # execute_task(2)
    return render(request, 'home_application/home.html')


def contact(request):
    """
    联系我们
    """
    return render(request, 'home_application/contact.html')

def hello(request):
    return render(request, 'home_application/helloworld.html')

